package org.example.logistic.listener;

import org.example.order.model.OrderInfo;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "order.create")
public class OrderListener {
    //这里能够根据类型的不同自动进行监听信息
    @RabbitHandler
    public void HandleMessage(String orderId) {
        System.out.println("接收到订单消息String:"+ orderId);
        //接收到订单消息之后, 进行相应的业务处理
        //业务代码省略
    }
    @RabbitHandler
    public void HandleMessage(OrderInfo orderId) {
        System.out.println("接收到订单消息OrderInfo:"+ orderId);
        //接收到订单消息之后, 进行相应的业务处理
        //业务代码省略
    }
}
